#ifndef JABSTRACTINPUTPANEL_H
#define JABSTRACTINPUTPANEL_H

#include <QWidget>
#include <QTECore/QTEGlobal>
#include "qtevirtualkeyboardglobal.h"

class QAbstractButton;

namespace QTE
{

class JAbstractInputPanelPrivate;

class Q_DECL_HIDDEN JAbstractInputPanel : public QWidget
{
	Q_OBJECT

protected:
	explicit JAbstractInputPanel(JAbstractInputPanelPrivate *d_ptr, QWidget *parent = nullptr);
	explicit JAbstractInputPanel(QWidget *parent = nullptr);

public:
	virtual ~JAbstractInputPanel() = 0;
	virtual void reset();

Q_SIGNALS:
	void keyPressed(QAbstractButton *button);
	void keyRelease(QAbstractButton *button);

Q_SIGNALS:
	void textInput(const QString &text);
	void keyInput(Qt::Key key);

protected:
	virtual void keyClicked(QAbstractButton *button);
	virtual void backSpace();

protected:
	void resizeEvent(QResizeEvent *event) override;

protected:
	friend class JAbstractInputPanelPrivate;
	JAbstractInputPanelPrivate *d_ptr;
};

#define InputPanelClassName(enumType) \
	QString("%1_%2").arg(enumType).arg(inputMethodName(enumType)).toLocal8Bit()

#define InputPanel_register(Type, enumType, ...) \
	QTE_type_register(Type, InputPanelClassName(enumType), __VA_ARGS__)

#define SymbolPanelClassName(enumType) \
	QString("%1_symbol_%2").arg(enumType).arg(inputMethodName(enumType)).toLocal8Bit()

#define SymbolPanel_register(Type, enumType, ...) \
	QTE_type_register(Type, SymbolPanelClassName(enumType), __VA_ARGS__)

} //namespace QTE


#endif //JABSTRACTINPUTPANEL_H
